#ifndef CONFIGXML_H
#define CONFIGXML_H

#if defined(__cplusplus)
#define CONFIG_EXTERN_C extern "C"
#else
#define CONFIG_EXTERN_C
#endif

#ifdef Q_OS_WIN
#define CONFIG_STDCALL __stdcall
#else
#define CONFIG_STDCALL
#endif


#include <QtCore/qglobal.h>
#if defined(CONFIGXML_LIBRARY)
#  define CONFIGXML_EXPORT  CONFIG_EXTERN_C CONFIG_STDCALL Q_DECL_EXPORT
#else
#  define CONFIGXML_EXPORT  CONFIG_EXTERN_C CONFIG_STDCALL Q_DECL_IMPORT
#endif

namespace Bob {

CONFIGXML_EXPORT int CreateInstance();
CONFIGXML_EXPORT void ReleaseInstance(int id);

CONFIGXML_EXPORT bool LoadFile(int id,const char*path);
CONFIGXML_EXPORT bool SaveFile(int id,const char*path);

CONFIGXML_EXPORT int ReadInt(int id,const char*key,int default_var);
CONFIGXML_EXPORT double ReadDouble(int id,const char*key,double default_var);
CONFIGXML_EXPORT bool ReadBool(int id,const char*key,bool default_var);
CONFIGXML_EXPORT const char* ReadStr(int id,const char*key,const char*default_var);
CONFIGXML_EXPORT bool WriteInt(int id,const char*key,int value);
CONFIGXML_EXPORT bool WriteDouble(int id,const char*key,double value);
CONFIGXML_EXPORT bool WriteBool(int id,const char*key,bool value);
CONFIGXML_EXPORT bool WriteStr(int id,const char*key,const char*value);

CONFIGXML_EXPORT void PrintDocument(int id);
CONFIGXML_EXPORT const char* GetDocumentStr(int id);
CONFIGXML_EXPORT bool RemoveElement(int id,const char*key);

}//namespace



#endif // CONFIGXML_H
